﻿package mortal.game.resource.tableConfig
{
    import Message.DB.Tables.*;
    import __AS3__.vec.*;
    import com.gengine.resource.*;
    import mortal.game.view.common.*;

    public class GuildLevelTargetConfig extends Object
    {
        private var _targetList:Vector.<TGuildLevelTarget>;
        private static var _instance:GuildLevelTargetConfig;

        public function GuildLevelTargetConfig()
        {
            if (_instance != null)
            {
                throw new Error("GuildLevelTargetConfig 单例 ");
            }
            this.init();
            return;
        }// end function

        public function init() : void
        {
            var _loc_1:* = ConfigManager.instance.getJSONByFileName("t_guild_level_target.json");
            this.write(_loc_1);
            return;
        }// end function

        private function write(param1:Object) : void
        {
            var _loc_2:TGuildLevelTarget = null;
            var _loc_3:Object = null;
            for each (_loc_3 in param1)
            {
                
                _loc_2 = new TGuildLevelTarget();
                ClassTypesUtil.copyValue(_loc_2, _loc_3);
                if (!this._targetList)
                {
                    this._targetList = new Vector.<TGuildLevelTarget>;
                }
                this._targetList.push(_loc_2);
            }
            return;
        }// end function

        public function getInfoByLevel(param1:int) : TGuildLevelTarget
        {
            if ((param1 - 1) >= this._targetList.length)
            {
                return null;
            }
            return this._targetList[(param1 - 1)];
        }// end function

        public function getTargetList() : Vector.<TGuildLevelTarget>
        {
            return this._targetList;
        }// end function

        public static function get instance() : GuildLevelTargetConfig
        {
            if (_instance == null)
            {
                _instance = new GuildLevelTargetConfig;
            }
            return _instance;
        }// end function

    }
}
